home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 452 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Array Parameters
  5. Date: Fri, 05 Jan 96 13:05:26 GMT
  6. Organization: none
  7. Message-ID: <820847126snz@genesis.demon.co.uk>
  8. References: <wayne.820650643@hawk> <4ce349$4j9@hacgate2.hac.com> <820701694snz@genesis.demon.co.uk> <4cg104$qmp@nervous.pdb.sni.de> <4cgmuc$k9k@hacgate2.hac.com> <4chic0$mkd@news.microsoft.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4chic0$mkd@news.microsoft.com>
  15.            a-cnadc@microsoft.com "Dann Corbit" writes:
  16.  
  17. >If you pass the struct by value you will get a copy of the whole structure.
  18. >This means that:
  19. >1.  All sizeof( struct foo ) bytes are piled onto the stack
  20. >2.  You can change the contents of the array in the function without 
  21. >    changing the contents of the array in the calling program.
  22.  
  23. <example program deleted>
  24.  
  25. Yes, it is easy to show that it makes a difference. However can you come
  26. up with an example where it is actually useful, i.e. you can't achieve the
  27. same overall effect more simply using other methods (e.g. with a local
  28. array in the called function)?
  29.  
  30. -- 
  31. -----------------------------------------
  32. Lawrence Kirby | fred@genesis.demon.co.uk
  33. Wilts, England | 70734.126@compuserve.com
  34. -----------------------------------------
  35.